package com.dailyye.sex360;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;

public class ImageAdapter extends BaseAdapter {
    private Context mContext;

    public ImageAdapter(Context c) {
        mContext = c;
    }

    public int getCount() {
        return mThumbIds.length;
    }

    public Object getItem(int position) {
        return null;
    }

    public long getItemId(int position) {
        return 0;
    }

    // create a new ImageView for each item referenced by the Adapter
    public View getView(int position, View convertView, ViewGroup parent) {
        ImageView imageView;
        if (convertView == null) {  // if it's not recycled, initialize some attributes
            imageView = new ImageView(mContext);
            imageView.setLayoutParams(new GridView.LayoutParams(80, 80));
            imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
            imageView.setPadding(4, 4, 4, 4);
        } else {
            imageView = (ImageView) convertView;
        }

        imageView.setImageResource(mThumbIds[position]);
        return imageView;
    }

    // references to our images
    private Integer[] mThumbIds = {
    		R.drawable.sex1facetoface, 
            R.drawable.sex2amazon,
            R.drawable.sex3arc,
            R.drawable.sex4kamasutra_armchair,
            R.drawable.sex5kamasutra_deep_one,
            R.drawable.sex6kamasutra_fusion,
            R.drawable.sex7kamasutra_hammock,
            R.drawable.sex8kamasutra_mill_vanes,
            R.drawable.sex9kamasutra_mirror_pleasing,
            R.drawable.sex10kamasutra_mold,
            R.drawable.sex11kamasutra_put_under_one,
            R.drawable.sex12kamasutra_screw,
            R.drawable.sex13kamasutra_surprise,
            R.drawable.sex14kamasutra_total_hug,
            R.drawable.sex15kamasutra_trapeze,
            R.drawable.sex16kamasutra_wheelbarrow,
            R.drawable.sex17kamasutra_facing_face,
            R.drawable.sex18kamasutra_medusa,
            R.drawable.sex19kamasutrafusion,
            R.drawable.sex20kamasutra_putunderone
    };
}